package com.gruppsex.trainingdiary;

import com.gruppsex.trainingdairy.R;

import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;


public class SettingsActivity extends Activity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		overridePendingTransition(R.anim.fadein, R.anim.fadeout);
		setContentView(R.layout.settings);
		
		
	}
	public void onClickUpdate(View v){
		switch (v.getId()) {
		case R.id.updateButton:
			final Dialog dialog = new Dialog(this);
			dialog.setTitle("Update profile");
			dialog.setCancelable(false);
			dialog.setContentView(R.layout.updateprofile);

			Button dialogButtonCancell = (Button) dialog
					.findViewById(R.id.buttonCancel);
			dialogButtonCancell.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					dialog.dismiss();
				}
			});
			final EditText ownActivity = (EditText) dialog
					.findViewById(R.id.editTextDiaName);

			Button dialogButtonOk = (Button) dialog
					.findViewById(R.id.buttonUpdateDia);
			dialogButtonOk.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					/*if (activity != "") {
						dbHelper.openDataBase();
						dbHelper.createActivityEntry(activity);
						dbHelper.close();
						Intent i = new Intent(WorkOutActivities.this,
								WorkOutActivities.class); // your class
						startActivity(i);
						finish();
					}*/
				}
			});
			ownActivity.addTextChangedListener(new TextWatcher() {

				@Override
				public void onTextChanged(CharSequence s, int start,
						int before, int count) {
					//activity = s.toString();
				}

				@Override
				public void beforeTextChanged(CharSequence s, int start,
						int count, int after) {
					// TODO Auto-generated method stub

				}

				@Override
				public void afterTextChanged(Editable s) {
					// TODO Auto-generated method stub

				}
			});

			dialog.show();
			break;
		}
		
	}
}
